package cn.yuanqiao.archive.liyong.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.utils.SecurityUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 关键词检索历史表对象
 *
 * @ProjectName: ruoyi-modules-system
 * @Package: cn.yuanqiao.archive.liyong.domain
 * @ClassName: YqVisitkeywords
 * @Author: lenovo
 * @Description: hbWang
 * @Date: 2023/7/27 14:16
 * @Version: 1.0
 */
public class YqVisitkeywords {
    private static final long serialVersionUID = 1L;
    private final String BIGTABLENAME = "_YQ_VISITKEYWORDS";
    private String tableName;

    public YqVisitkeywords() {
        String tenantCode = SecurityUtils.getTenantCode();
        if (StringUtils.isEmpty(tenantCode)) {
            throw new ServiceException("TenantCode is null");
        } else {
            this.tableName = tenantCode.toUpperCase() + BIGTABLENAME;
        }
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    /**
     * 检索机器名
     */
    @Excel(name = "检索机器名")
    private String machineName;

    /**
     * 检索机器IP
     */
    @Excel(name = "检索机器IP")
    private String ip;

    /**
     * 检索时间
     */
    @Excel(name = "检索时间")
    private String visitDate;

    /**
     * 关键词
     */
    @Excel(name = "关键词")
    private String keywords;

    /**
     * 检索人登录名
     */
    @Excel(name = "检索人登录名")
    private String userName;

    /**
     * 检索人ID
     */
    @Excel(name = "检索人ID")
    private String userId;

    /**
     * 菜单id
     */
    @Excel(name = "菜单id")
    private String menuId;

    public void setMachineName(String machineName) {
        this.machineName = machineName;
    }

    public String getMachineName() {
        return machineName;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getIp() {
        return ip;
    }

    public void setVisitDate(String visitDate) {
        this.visitDate = visitDate;
    }

    public String getVisitDate() {
        return visitDate;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserId() {
        return userId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public String getMenuId() {
        return menuId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("machineName", getMachineName())
                .append("ip", getIp())
                .append("visitDate", getVisitDate())
                .append("keywords", getKeywords())
                .append("userName", getUserName())
                .append("userId", getUserId())
                .append("menuId", getMenuId())
                .toString();
    }
}
